use(["public/javascripts/service/service_transportCloudService.js",
    "public/common/classNames.js",
    "public/javascripts/widget/select/select.js",
    "public/javascripts/service_transportCloud/portlist.js",
    "public/javascripts/service_transportCloud/airportlist.js"
    ], function(service_transportCloudService, classNames,Select, portlist, airportList) {
    var PageComponent = React.createClass({
        componentWillMount: function () {
            for (var i in service_transportCloudService) this[i] = service_transportCloudService[i].bind(this);
            this.changePanel = function(e){
                if($(e.target).hasClass('tab-active')){
                    return;
                }
                $(e.target).addClass('tab-active').siblings().removeClass('tab-active');
                if(e.target.id === 'tab_airport'){
                    $('.tab-list-wrap').removeClass('changed');
                    $('#panel_airport').addClass('panel-active').siblings().removeClass('panel-active');
                }else {
                    $('.tab-list-wrap').addClass('changed');
                    $('#panel_port').addClass('panel-active').siblings().removeClass('panel-active');
                }
            }
        },
        componentDidMount: function() {
            var self = this;
            self.getPortType();
            self.getStartPort(portlist);
            self.getEndPort(portlist);
            self.getAirportType();
            self.getStartAirport(airportList);
            self.getEndAirport(airportList);
            self.getCountry();
            self.getStorehouse();
            self.getUsableArea();
            self.getPrice();
            self.getOthers();
        },
        receiveMsg: function(data) {

        },
        getInitialState: function () {
            return {
                portType: "拼箱",
                startPort: "起运港",
                endPort: "目的港",
                airportType: "拼舱",
                startAirport: "始发",
                endAirport: "终到",
                country: "选择城市",
                storeHouse: "仓库类型",
                usableArea: "可用面积",
                price: "价格范围",
                others: "其他条件"
            };
        },
        render:function() {
            var data = this.state.data;
            return ~init;
        }
    });
    if(typeof ReactDOM != "undefined") {
        ReactDOM.render(<PageComponent data={storage}/>, document.getElementById('container'));
    }
    module.exports = PageComponent;
});